<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>管理中心</title>
	<link rel="stylesheet" type="text/css" href="static/css/main.css">
	<!-- Echarts3 -->
	<script type="text/javascript" src="static/lib/echarts.min.js"></script>
	<!-- 全国344个市、区、州对应的数字编号 -->
	<script type="text/javascript" src="static/js/citymap.js"></script>
</head>
<body>
<div id="main" style="width: 100%;height:800px;"></div>
<div class="modal">
  <div id="trend-line">
    <!-- js渲染趋势图数据 -->
    <div id="line-trend"></div>
  </div>
</div>
<script type="text/javascript" src="static/lib/jquery.1.9.1.min.js"></script>
<script src="static/lib/vue.2.6.10.js"></script>
<script type="text/javascript" src="static/js/common.js"></script>
<script type="text/javascript" src="static/js/app.js"></script>
<script>
	function UrlEncode(str){
		var ret="";
		var strSpecial="!\"#$%&'()*+,/:;<=>?[]^`{|}~%";
		for(var i=0;i<str.length;i++){
			var chr = str.charAt(i);
			var c=str2asc(chr);
			tt += chr+":"+c+"n";
			if(parseInt("0x"+c) > 0x7f){
				ret+="%"+c.slice(0,2)+"%"+c.slice(-2);
			}else{
				if(chr==" ")
					ret+="+";
				else if(strSpecial.indexOf(chr)!=-1)
					ret+="%"+c.toString(16);
				else
					ret+=chr;
			}
		}
		return ret;
	}
	//UrlDecode函数：
	function UrlDecode(str){
		var ret="";
		for(var i=0;i<str.length;i++){
			var chr = str.charAt(i);
			if(chr == "+"){
				ret+=" ";
			}else if(chr=="%"){
				var asc = str.substring(i+1,i+3);
				if(parseInt("0x"+asc)>0x7f){
					ret+=asc2str(parseInt("0x"+asc+str.substring(i+4,i+6)));
					i+=5;
				}else{
					ret+=asc2str(parseInt("0x"+asc));
					i+=2;
				}
			}else{
				ret+= chr;
			}
		}
		return ret;
	}

	function GetUrlByParamName(name)
	{
		var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
		var URL =  decodeURI(window.location.search);
		var r = URL.substr(1).match(reg);
		if(r!=null){
			//decodeURI() 函数可对 encodeURI() 函数编码过的 URI 进行解码
			return  decodeURI(r[2]);
		};
		return null;
	}
	var cityName = GetUrlByParamName("city");
	if(cityName in provinces){
		var testArea1 = {
			name:cityName,
			data:{
				id:provinces[cityName],
				name:cityName
			}
		}
		renderByAreaParams(testArea1);
	}else{
		var testArea = {
			name:cityName,
			data:{
				//id:cityMap[cityName],
				cityid:cityMap[cityName],
				name:cityName
			}
		}
		console.log("当前城市："+testArea.name+":"+cityMap[testArea.name]);
		renderByAreaParams(testArea);
	}

</script>
</body>
</html>
